import com.chen.entity.People;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        ArrayList<People> peopleList = new ArrayList<>();
        int num=(int)(Math.random()*(150-80+1))+80;
        System.out.println(num);
        for (int i = 0; i <num ; i++) {
            peopleList.add(new People("people"+i));
        }

        ArrayList<People> ok = new ArrayList<>();
        People zhangsan = new People("张三");
        Integer zsAge = zhangsan.getAge();
        if(zhangsan.getGender()==false){
            for (People people : peopleList) {
                if(people.getGender()==true){
                    if(people.getAge()-zsAge==2 || zsAge-people.getAge()==6){
                        System.out.println("配对成功");
                        ok.add(people);
                    }
                }
            }
        }
        if(zhangsan.getGender()==true){
            for (People people : peopleList) {
                if(people.getGender()==false){
                    if(people.getAge()-zsAge==1 || zsAge-people.getAge()==6){
                        System.out.println("配对成功");
                        ok.add(people);
                    }
                }
            }
        }
        System.out.println(zhangsan);

        for (People people : ok) {
            System.out.println(people);
        }


    }
}
